/**
 * @author: 小红
 * @date: 2025/3/26
 * @Description: 笔记
 */

import http from '@/utils/http';
import type { _AxiosRequestConfig } from '@/utils/http/types';
import type { NoteEntity } from '@/entity/note/NoteEntity';

/**
 * 笔记分页
 * @param params
 * @param options
 * @constructor
 */
export const ApiNoteList = (params: any, options?: _AxiosRequestConfig) => http.get<NoteEntity[], true>(`/infra/notes/page`, params, options);

/**
 * 添加笔记
 * @param data
 * @param options
 * @constructor
 */
export const ApiNoteAdd = (data: any, options?: _AxiosRequestConfig) => http.post<NoteEntity[]>(`/infra/notes/create`, data, options);

/**
 * 更新笔记
 * @param data
 * @param options
 * @constructor
 */
export const ApiNoteUpdate = (data: any, options?: _AxiosRequestConfig) => http.put(`/infra/notes/update`, data, options);

/**
 * 删除笔记
 * @param id
 * @param options
 * @constructor
 */
export const ApiNoteDelete = (id: number | string, options?: _AxiosRequestConfig) => http.delete(`/infra/notes/delete/${id}`, {}, options);
